package com.lkbaby.singleton;

public class Student implements Cloneable {
	private int id;
	private String name;
	private int score;

	// 复制新对象并返回; 重写方法，返回值需强转
	@Override
	public Object clone() {
		Student std = new Student();
		std.id = this.id;
		std.name = this.name;
		std.score = this.score;
		return std;
	}

	// 自定义复制方法
	public Student copy() {
		Student std = new Student();
		std.id = this.id;
		std.name = this.name;
		std.score = this.score;
		return std;
	}
}
